home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 93 / CDMM_93_2.ISO / Project Nomads / nomads_demo_eng.exe / PAWNSHOP.TCL < prev    next >
Encoding:
Text File  |  2002-04-19  |  7.3 KB  |  287 lines

  1. #
  2. #   Zustands-▄berwachungs-Script
  3. #   State Watch Script
  4. #
  5. #   Pawnshop
  6. #
  7.  
  8. proc pawnshopwatch_normal {} {
  9.  
  10.     # vorerst hier unzerstoerbar. Bleibt so, bis es aufgesammelt
  11.     # (in BackPack) oder gebaut (kein Artefakt mehr) wird 
  12.     if {[.getartefactmode] == "false"} {
  13.         .announcestate house
  14.     } elseif {[.iscollected] == "true"} {
  15.         .announcestate backpack
  16.     } elseif {[.getcharges] <= 0} {
  17.         .setremoveable true
  18.     } elseif {[.getcreator] != "null"} {
  19.         .announcestate infactoryslot
  20.     }
  21. }
  22.  
  23. proc pawnshopwatch_infactoryslot {} {
  24.  
  25.     # vorerst hier unzerstoerbar. Bleibt so, bis es aufgesammelt
  26.     # (in BackPack) oder gebaut (kein Artefakt mehr) wird 
  27.     if {[.getartefactmode] == "false"} {
  28.         .announcestate house
  29.     } elseif {[.iscollected] == "true"} {
  30.         .announcestate backpack
  31.     } elseif {[.getcharges] <= 0} {
  32.         .setremoveable true
  33.     } elseif {[.getcreator] == "null"} {
  34.         .announcestate normal
  35.     }
  36. }
  37.  
  38. proc pawnshopwatch_bauphase {} {
  39.  
  40.     # kann zerstoert oder wieder zusammengeklappt werden
  41.     if {[.iskilled] == "true"} {
  42.         .announcestate explode
  43.     } elseif {[.getartefactmode] == "true"} {
  44.         .announcestate normal
  45.     } elseif {[.isstatetimeover] == "true"} {
  46.         .announcestate house
  47.     }
  48. }
  49.  
  50.  
  51. proc pawnshopwatch_house {} {
  52.  
  53.     # kann zerstoert oder wieder zusammengeklappt werden
  54.     if {[.iskilled] == "true"} {
  55.         .announcestate explode
  56.     } elseif {[.getartefactmode] == "true"} {
  57.         .announcestate normal
  58.     } elseif {[.isworking] == "true"} {
  59.         .announcestate working
  60.     } elseif {[.ismaennelinside] == "true"} {
  61.         .announcestate offer
  62.     }
  63. }
  64.  
  65. proc pawnshopwatch_offer {} {
  66.  
  67.     # kann zerstoert oder wieder zusammengeklappt werden
  68.     if {[.iskilled] == "true"} {
  69.         .announcestate explode
  70.     } elseif {[.getartefactmode] == "true"} {
  71.         .announcestate normal
  72.     } elseif {[.isanimfinished] == "true"} {
  73.         .announcestate trade
  74.     }
  75. }
  76.  
  77. proc pawnshopwatch_trade {} {
  78.  
  79.     # kann zerstoert oder wieder zusammengeklappt werden
  80.     if {[.iskilled] == "true"} {
  81.         .announcestate explode
  82.     } elseif {[.getartefactmode] == "true"} {
  83.         .announcestate normal
  84.     } elseif {[.istradecancelled] == "true"} {
  85.         # Handel abgebrochen?
  86.         .announcestate cancelled
  87.     } elseif {[.istradefinished] == "true"} {
  88.         # Handel getaetigt?
  89.         .announcestate finished
  90.     } elseif {[.ismaennelinside] == "false"} {
  91.         # einfach so (ohne offenes Menue) verlassen?
  92.         if {"null" != [.getproduct 0]} {
  93.             .announcestate hide
  94.         } else {
  95.             .announcestate house
  96.         }
  97.     } elseif {[.iscontentmentlevel1] == "true"} {
  98.         .announcestate muchtooless
  99.     } elseif {[.iscontentmentlevel2] == "true"} {
  100.         .announcestate tooless
  101.     } elseif {[.iscontentmentlevel3] == "true"} {
  102.         .announcestate enough
  103.     }
  104. }
  105.  
  106. proc pawnshopwatch_finished {} {
  107.  
  108.     # kann zerstoert oder wieder zusammengeklappt werden
  109.     if {[.iskilled] == "true"} {
  110.         .announcestate explode
  111.     } elseif {[.getartefactmode] == "true"} {
  112.         .announcestate normal
  113.     } elseif {[.isanimfinished] == "true"} {
  114.         if {[.getproduct 0] == "null"} {
  115.             # kein produkt mehr
  116.             .announcestate habenix
  117.         } else {
  118.             # erneut offerieren
  119.             .announcestate offer
  120.         }
  121.     }
  122. }
  123.  
  124. proc pawnshopwatch_cancelled {} {
  125.  
  126.     # kann zerstoert oder wieder zusammengeklappt werden
  127.     if {[.iskilled] == "true"} {
  128.         .announcestate explode
  129.     } elseif {[.getartefactmode] == "true"} {
  130.         .announcestate normal
  131.     } elseif {[.isanimfinished] == "true"} {
  132.         if {[.getproduct 0] == "null"} {
  133.             # kein produkt mehr
  134.             .announcestate habenix
  135.         } else {
  136.             # erneut offerieren
  137.             .announcestate offer
  138.         }
  139.     }
  140. }
  141.  
  142. proc pawnshopwatch_habenix {} {
  143.  
  144.     # kann zerstoert oder wieder zusammengeklappt werden
  145.     if {[.iskilled] == "true"} {
  146.         .announcestate explode
  147.     } elseif {[.getartefactmode] == "true"} {
  148.         .announcestate normal
  149.     } elseif {[.isanimfinished] == "true"} {
  150.         .announcestate house
  151.     }
  152. }
  153.  
  154. proc pawnshopwatch_hide {} {
  155.  
  156.     # kann zerstoert oder wieder zusammengeklappt werden
  157.     if {[.iskilled] == "true"} {
  158.         .announcestate explode
  159.     } elseif {[.getartefactmode] == "true"} {
  160.         .announcestate normal
  161.     } elseif {[.isanimfinished] == "true"} {
  162.         .announcestate house
  163.     }
  164. }
  165.  
  166. proc pawnshopwatch_muchtooless {} {
  167.  
  168.     # kann zerstoert oder wieder zusammengeklappt werden
  169.     if {[.iskilled] == "true"} {
  170.         .announcestate explode
  171.     } elseif {[.getartefactmode] == "true"} {
  172.         .announcestate normal
  173.     } elseif {[.isanimfinished] == "true"} {
  174.         .announcestate trade
  175.     }
  176. }
  177.  
  178. proc pawnshopwatch_tooless {} {
  179.  
  180.     # kann zerstoert oder wieder zusammengeklappt werden
  181.     if {[.iskilled] == "true"} {
  182.         .announcestate explode
  183.     } elseif {[.getartefactmode] == "true"} {
  184.         .announcestate normal
  185.     } elseif {[.isanimfinished] == "true"} {
  186.         .announcestate trade
  187.     }
  188. }
  189.  
  190. proc pawnshopwatch_enough {} {
  191.  
  192.     # kann zerstoert oder wieder zusammengeklappt werden
  193.     if {[.iskilled] == "true"} {
  194.         .announcestate explode
  195.     } elseif {[.getartefactmode] == "true"} {
  196.         .announcestate normal
  197.     } elseif {[.isanimfinished] == "true"} {
  198.         .announcestate trade
  199.     }
  200. }
  201.  
  202.  
  203. proc pawnshopwatch_working {} {
  204.  
  205.     # kann zerstoert oder wieder zusammengeklappt werden
  206.     if {[.iskilled] == "true"} {
  207.         .announcestate explode
  208.     } elseif {[.getartefactmode] == "true"} {
  209.         .announcestate normal
  210.     } elseif {[.isworking] == "false"} {
  211.         .announcestate house
  212.     }
  213. }
  214.  
  215. proc pawnshopwatch_explode {} {
  216.  
  217.     # Uebergang zum Artefakt oder Wegnehmen
  218.     if {[.isanimfinished] == "true"} {
  219.         if {[.getcharges] <= 0} {
  220.             .setremoveable true
  221.         } else {
  222.             .announcestate normal
  223.             .removefromisland
  224.         }
  225.     }
  226. }
  227.  
  228. proc pawnshopwatch_backpack {} {
  229.  
  230.     # Moeglich: usgeworfen (Nicht mehr "gesammelt") oder im
  231.     # Menue gezeigt (sichtbar)
  232.     if {[.iscollected] == "false"} {
  233.         .announcestate normal
  234.     } elseif {[.isvisible] == "true"} {
  235.         .announcestate menue
  236.     }
  237. }
  238.  
  239. proc pawnshopwatch_menu {} {
  240.  
  241.     if {[.isvisible] == "false"} {
  242.         .announcestate backpack
  243.     } elseif {[.getartefactuse] == "true"} {
  244.         .announcestate build
  245.     } elseif {[.iscollected] == "false"} {
  246.         .announcestate normal
  247.     }
  248. }
  249.  
  250. proc pawnshopwatch_build {} {
  251.  
  252.     if {[.iskilled] == "true"} {
  253.         .announcestate explode
  254.     } elseif {[.getartefactmode] == "false"} {
  255.         .announcestate bauphase
  256.     } elseif {[.getartefactuse] == "false"} {
  257.         .announcestate backpack
  258.     }
  259. }
  260.  
  261. proc pawnshopwatch_cinematic {} {
  262.  
  263.     # empty
  264. }    
  265.  
  266.  
  267. #-------------------------------------------------------------------------------
  268.  
  269. proc hideartefact {} {
  270.  
  271.     set product [.getproduct 0]
  272.     if {"null" != $product} {
  273.     
  274.         $product.setvisible false
  275.     }
  276. }
  277.  
  278. proc presentartefact {} {
  279.  
  280.     set product [.getproduct 0]
  281.     if {"null" != $product} {
  282.     
  283.         $product.setvisible true
  284.     }
  285. }
  286.  
  287.